package cn.ciis.ciis.enterprise;

import com.jfinal.core.Controller;
import cn.ciis.basic.base.BaseValidator;

/**
 * EnterpriseAdminValidator 验证企业信息功能表单
 *
 * @author 冉志林
 */
public class EnterpriseAdminValidator extends BaseValidator {
    @Override
    protected void validate(Controller c) {
        setShortCircuit(true);
        validateRequired("enterprise.code","编号");
        validateRequired("enterprise.name","名称");
    }

    @Override
    protected void handleError(Controller c) {
        c.setAttr("state", "fail");
        c.renderJson();
    }
}